package com.ruanko.banking;

/**
 * 银行卡基类
 * 
 */
public abstract class Card {

	/**
	 * 余额
	 */
	protected double balance;
	
	/**
	 * 初始化银行卡金额
	 */
	public Card() {
		this.balance = 0.0;
	}
	
	/**
	 * 根据参数初始化银行卡金额
	 * @param balance
	 */
	public Card(final double balance) {
		this.balance = balance;
	}
	
	/**
	 * 存款
	 * @param money 金额(大于零)
	 */
	public abstract void save(final double money);
	
	/**
	 * 取款
	 * @param money 金额(大于零)
	 */
	public abstract void take(final double money);
	
	/**
	 * 查询余额
	 * @return
	 */
	public double getBalance() {
		return this.balance;
	}
}
